x86 hvm: small cleanup in vpmu
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:04:58 +0000 (08:04 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Sep 2009 07:04:58 +0000 (08:04 +0100)
Replace the special vpmu define LVTPC_HVM_PMU with the global
used define PMU_APIC_VECTOR to avoid different names for the
same thing.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/include/asm-x86/hvm/vmx/vpmu.h

index 37054f22ebf327d5d59ec9b7ec5eca57de1555c8..a390f7485538a3b84a4d6cf2a7717068eed68c5f 100644 (file)
@@ -178,7 +178,7 @@ static inline void __core2_vpmu_save(struct vcpu *v)
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
     core2_vpmu_cxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
-    apic_write(APIC_LVTPC, LVTPC_HVM_PMU | APIC_LVT_MASKED);
+    apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
 }
 
 static void core2_vpmu_save(struct vcpu *v)
@@ -398,9 +398,9 @@ static int core2_vpmu_do_wrmsr(struct cpu_user_regs *regs)
     /* Setup LVTPC in local apic */
     if ( vpmu->flags & VPMU_RUNNING &&
          is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
-        apic_write_around(APIC_LVTPC, LVTPC_HVM_PMU);
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
     else
-        apic_write_around(APIC_LVTPC, LVTPC_HVM_PMU | APIC_LVT_MASKED);
+        apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
 
     core2_vpmu_save_msr_context(v, type, index, msr_content);
     if ( type != MSR_TYPE_GLOBAL )
index 9598b7d7948d32eab78a7f55717514a57f4a9010..5f5f2e344ff0245fec5f68c63fbc738a51f8d503 100644 (file)
@@ -34,8 +34,6 @@
 #define MSR_TYPE_ARCH_COUNTER       3
 #define MSR_TYPE_ARCH_CTRL          4
 
-#define LVTPC_HVM_PMU            0xf8
-
 struct pmumsr {
     unsigned int num;
     u32 *msr;